home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Texteditors / GoldED Tools / GoldDock / ARexx / InsertICON.ged < prev    next >
Encoding:
Text File  |  1996-09-27  |  1.4 KB  |  45 lines

  1. /* $VER: 0.1, ©1994 Markus Aretz 
  2.     Insert definition of an image-object in current window */
  3.  
  4. OPTIONS RESULTS                             /* enable return codes     */
  5.  
  6. if (LEFT(ADDRESS(), 6) ~= "GOLDED") then    /* not started by GoldEd ? */
  7.     address 'GOLDED.1'
  8.  
  9. 'LOCK CURRENT'                              /* lock GUI, gain access   */
  10. OPTIONS FAILAT 6                            /* ignore warnings         */
  11. SIGNAL ON SYNTAX                            /* ensure clean exit       */
  12.  
  13.  
  14. /* ------------------------------------------------------------------- */
  15.  
  16. PARSE ARG IconPath .
  17. 'REQUEST BODY "Bild-Objekt erzeugen?" BUTTON "_Ja|_Nein"'
  18. IF RESULT=1 THEN DO
  19.     'REQUEST MASK "#?.iff" FILE TITLE "Bild-Datei auswählen" PATH "'IconPath'" VAR ICONNAME'
  20.     'REQUEST MASK ""'
  21.     IF ~(ICONNAME="ICONNAME") THEN DO
  22.         lpos=lastpos('/',ICONNAME)
  23.         IF lpos>0 THEN ObjName=substr(IconName,lpos+1)
  24.         ELSE ObjName=IconName
  25.         'REQUEST BODY "Bitte Objektnamen eingeben" STRING OLD="'ObjName'" VAR OBJNAME'
  26.         IF ~(RESULT=0) THEN DO
  27.             'INSERT LINE'
  28.             'GOTO COLUMN 1'
  29.             'TEXT T="ICON *"'OBJNAME'*"     *"'ICONNAME'*""'
  30.     END
  31. END
  32.  
  33. /* ------------------------------------------------------------------- */
  34.  
  35. 'UNLOCK' /* VERY important: unlock GUI */
  36. EXIT
  37.  
  38. SYNTAX:
  39.  
  40. SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
  41. 'UNLOCK'
  42. EXIT
  43.  
  44.  
  45.